<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.util.*,
						com.ophelisis.common.util.*,
						com.ophelisis.common.consts.*,
						com.ophelisis.actions.system.*"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<script>
$(document).ready(function() {
	if ($("#categoryFirst option").length < 2) {
		$("#categoryFirst").parent().parent().remove();
	} else {
		if ($("#categorySecond option").length < 2) {
			$("#categorySecond").remove();
			$("#categoryThird").remove();
		} else {
			if ($("#categoryThird option").length < 2) {
				$("#categoryThird").remove();
			}
		}
	}
});
</script>
<%@ include file="/WEB-INF/jsp/common/resultMessageLocal.jsp"%>
<div id="formlist1" class="noborder">
	<input type="hidden" id="loadCheck" name="loadCheck" value="OK" />
	<form id="searchForm" name="searchForm" method="post" enctype="multipart/form-data">
		<input type="hidden" id="_groupId" name="_groupId" value="${_groupId}" />
		<input type="hidden" id="_menuId" name="_menuId" value="${_menuId}" />
		<input type="hidden" id="_menuType" name="_menuType" value="${_menuType}" />
		<input type="hidden" id="_menuNm" name="_menuNm" value="${_menuNm}" />
		<input type="hidden" id="_menuAuth" name="_menuAuth" value="${_menuAuth}" />
		<input type="hidden" id="_prevUpCode" name="_prevUpCode" value="${_prevUpCode}" />
		<input type="hidden" id="_prevCode" name="_prevCode" value="${_prevCode}" />
		<input type="hidden" id="_startRowNo" name="_startRowNo" value="${_startRowNo}" />
		<input type="hidden" id="_pageSize" name="_pageSize" value="${_pageSize}" />
    	<input type="hidden" id="searchVal1" name="searchVal1" value="${searchVal1}" />
    	<input type="hidden" id="isNew" name="isNew" value="Y" />
    	<input type="hidden" id="categoryId" name="categoryId" value="0" />
		<table class="viewstyle1">
			<colgroup>
				<col width="130" />
				<col width="" />
			</colgroup>
			<tr>
				<td class="titleColumn" colspan="2">기본 정보</td>
			</tr>
			<tr>
				<th scope="col">제목</th>
				<td scope="col"><input type="text" id="boardNm" name="boardNm" class="in3 intex_l width_700p" value="" /></td>
			</tr>
			<tr>
				<th scope="col">카테고리</th>
				<td scope="col">
				<select id="categoryFirst" name="categoryFirst" class="in3 intex_l" onchange="javascript:pmModule.selectCategory('1', this.value);">
					<option value="">== 1차 카테고리 ==</option>
					<c:choose>
						<c:when test="${categoryList != '' && !empty categoryList}">
							<c:forEach var="cfList" items="${categoryList}" varStatus="status">
								<c:if test="${cfList.categoryType == '1'}">
									<option value="${cfList.categoryId}">${cfList.categoryNm}</option>
								</c:if>
							</c:forEach>
						</c:when>
					</c:choose>
				</select>
				<select id="categorySecond" name="categorySecond" class="in3 intex_l" onchange="javascript:pmModule.selectCategory('2', this.value);">
					<option value="">== 2차 카테고리 ==</option>
					<c:choose>
						<c:when test="${categoryList != '' && !empty categoryList}">
							<c:forEach var="csList" items="${categoryList}" varStatus="status">
								<c:if test="${csList.categoryType == '2'}">
									<option value="${csList.categoryId}" first="${csList.categoryFirst}">${csList.categoryNm}</option>
								</c:if>
							</c:forEach>
						</c:when>
					</c:choose>
				</select>
				<select id="categoryThird" name="categoryThird" class="in3 intex_l" onchange="javascript:pmModule.selectCategory('3', this.value);">
					<option value="">== 3차 카테고리 ==</option>
					<c:choose>
						<c:when test="${categoryList != '' && !empty categoryList}">
							<c:forEach var="ctList" items="${categoryList}" varStatus="status">
								<c:if test="${ctList.categoryType == '3'}">
									<option value="${ctList.categoryId}" first="${ctList.categoryFirst}" second="${ctList.categorySecond}">${ctList.categoryNm}</option>
								</c:if>
							</c:forEach>
						</c:when>
					</c:choose>
				</select>
				</td>
			</tr>
			<tr>
				<th>내용</th>
				<td>
				<textarea id="boardDesc" name="boardDesc" class="width_700p height_250p"></textarea>
				</td>
			</tr>
			<tr>
				<th><img src="images/btn/btn_form_add.gif" class="pdt3 clickable" onclick="javascript:pmModule.setFileAdd(this);" /></th>
				<td><span class="red pdl5">이미지 크기는 1MB 이하를 권장합니다.(너무 크면 로딩시간이 길어집니다.)</span></td>
			</tr>
			<tr>
				<th>첨부 파일 #1</th>
	            <td>
	            <input type="file" id="boardFile1" name="boardFile1" class="input_text" />
	            </td>
			</tr>
			<tr>
				<th>첨부 파일 #2</th>
	            <td>
	            <input type="file" id="boardFile2" name="boardFile2" class="input_text" />
	            </td>
			</tr>
		</table>
	</form>
	<div id="lowbtn">
		<a href="javascript:pmModule.reset('clear');"><img src="images/btn/btn_cancel01.gif" /></a>
		<a href="javascript:pmModule.save();"><img src="images/btn/btn_save01.gif" /></a>  
		<a href="javascript:pmModule.getList();"><img src="images/btn/btn_list01.gif" /></a>
	</div>
</div>
